home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Whiteline: delta
/
whiteline CD Series - delta.iso
/
vision
/
povray
/
tools
/
bspline
/
bspline.txt
< prev
next >
Wrap
Text File
|
1995-11-25
|
2KB
|
71 lines
pov-bspline 1.0
===============
What's it do?: This program takes x,y,z triplets for input, and
outputs a .pov or .inc file with a b-spline made of cones and
spheres.
How to compile this thing: cc -o bspline bspline.c -lm
Then, type "bspline -h" to see a summary of the options.
syntax: bspline [options] < infile > whatever.pov
version: 0.2
options: -h - This help.
-i - make a pov include file, not a pov scene file.
-t n - Make spline n thickness. (default 1.0)
-n n - Use n points per control point. (default 5)
-p n - Degree of polynomial (2-6, default 4)
infile should contain only a list of x,y,z points to influence the b-spline.
An example infile would look like:
0 0 0
1 0 0
1.5 1 0
1 2 0
(etc, etc..) Just the coordinates of the "control points".
The b-spline starts and ends at the first and last control point, but
does not necessarily go through all of the other points. The other
points influence the direction of the spline. A spline that actually
goes through all the points is a cubic spline. This program does not
(yet) support cubic splines.
Note that this is version 1.0. Brand new. I wrote this in one
afternoon. There may be problems lurking inside of it. If you find
one, or you add some feature (be it neat-o or merely pedestrian), mail
me (meek@alpha2.csd.uwm.edu). I'd be very grateful.
The options:
-h Help.
-i Make an include file. This omits the standard boilerplate camera
and light source. Just output it to a .inc file, and #include it
in your favorite scene.
-t n Make the spline n units thick, where n is a floating point
number. Imagine the spline as a snake. This is how fat the
snake is.
-n n This puts n points per control point in the spline. Higher
values of n lead to smoother curves. Too high makes your
rendering mighty slow. The default is 5.
-p n Use degree n of polynomial. Degree 2 is the moral equivalent
of connect-the-dots; you'd have your points connected by
straight lines, not splines. If you do that, also do "-n 1".
Each higher degree is less influenced by the points, and would
be "straighter". Like everything in raytracing, it's best
to keep experimenting with the values, until you get something
that looks 'right'.
I hope this program is of some utility to you..
-Michael